<?php
/*
	更换背景图片
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['list']=array();
	for($i=1;$i<17;$i++){
		$return['list'][]=array('url'=>$this->plugin_resource.'images/bgimg/bg'.$i.'.jpg');
	}
	$return['choose_type']=1;
	$return['item']=$this->get('card',array('mid'=>$_SESSION['uid']),array('bgimg'));
	exi($return);
}
if($_RQ['op']=='post'){
	$post=get_postdata();
	if(!$post['bgimg']){
		exi('请先选择图片！','error');
	}
	$this->update('card',array('bgimg'=>trim($post['bgimg'])),array('mid'=>$_SESSION['uid']));
	exi('设置成功！','','goback');
}